import app from "./app.js";

const port = process.env.PORT || 3000;

// 添加彩色输出的辅助函数
const colors = {
  green: (text) => `\x1b[32m${text}\x1b[0m`,
  blue: (text) => `\x1b[34m${text}\x1b[0m`,
  yellow: (text) => `\x1b[33m${text}\x1b[0m`,
  cyan: (text) => `\x1b[36m${text}\x1b[0m`,
};

app.listen(port, () => {
  console.log("\n" + "=".repeat(50));
  console.log(colors.green("✓ 七鱼 API服务器启动成功！"));
  console.log(colors.blue(`✓ 本地服务器地址: http://localhost:${port}`));
  console.log(
    colors.yellow(`✓ 测试页面地址: http://localhost:${port}/index.html`)
  );
  console.log(colors.cyan("✓ 按 Ctrl+C 停止服务器"));
  console.log("=".repeat(50) + "\n");
});
